/**
 * 通知相关类型定义
 */

/**
 * 通知类型枚举
 */
export enum NotificationType {
  // 项目相关
  PROJECT_CREATED = 'project_created', // 项目创建
  PROJECT_UPDATED = 'project_updated', // 项目更新
  PROJECT_DELETED = 'project_deleted', // 项目删除
  PROJECT_MEMBER_ADDED = 'project_member_added', // 项目成员添加
  // 需求相关
  REQUIREMENT_CREATED = 'requirement_created', // 需求创建
  REQUIREMENT_UPDATED = 'requirement_updated', // 需求更新
  REQUIREMENT_DELETED = 'requirement_deleted', // 需求删除
  // 任务相关
  TASK_CREATED = 'task_created', // 任务创建
  TASK_ASSIGNED = 'task_assigned', // 任务分配
  TASK_UPDATED = 'task_updated', // 任务更新
  TASK_COMPLETED = 'task_completed', // 任务完成
  TASK_STATUS_CHANGED = 'task_status_changed', // 任务状态变更
  TASK_DELETED = 'task_deleted', // 任务删除
  TASK_DEADLINE_REMINDER = 'task_deadline_reminder', // 任务截止日期提醒
  // 缺陷相关
  DEFECT_CREATED = 'defect_created', // 缺陷创建
  DEFECT_UPDATED = 'defect_updated', // 缺陷更新
  DEFECT_DELETED = 'defect_deleted', // 缺陷删除
  // 其他
  COMMENT_ADDED = 'comment_added', // 评论添加
  VERSION_UPDATED = 'version_updated' // 版本更新
}

/**
 * 关联对象类型枚举
 */
export enum RelatedObjectType {
  TASK = 'task',
  PROJECT = 'project',
  REQUIREMENT = 'requirement',
  VERSION = 'version',
  COMMENT = 'comment',
  DEFECT = 'defect',
  TEST_CASE = 'test_case'
}

/**
 * 通知接口
 */
export interface Notification {
  id: string
  user_id: string
  type: NotificationType | string
  title: string
  content: string
  related_type?: RelatedObjectType | string
  related_id?: string
  is_read: boolean
  read_at?: string
  created_at: string
  metadata?: Record<string, any>
}

/**
 * 通知列表响应
 */
export interface NotificationListResponse {
  data: Notification[]
  total: number
  page: number
  limit: number
}

/**
 * 未读通知数量响应
 */
export interface UnreadCountResponse {
  count: number
}

/**
 * 通知筛选参数
 */
export interface NotificationFilterParams {
  page?: number
  limit?: number
  is_read?: boolean
  type?: string
  sort_by?: string
  sort_order?: 'asc' | 'desc'
}

